package com.xpgk.mvc.binShopService;

import java.util.List;

import com.jfinal.log.Log;
import com.xpgk.annotation.Table;
import com.xpgk.mvc.base.BaseModel;


/**
 * 顾客服务model
 */
@SuppressWarnings("unused")
@Table(tableName = CustomerService.table_name)
public class CustomerService  extends  BaseModel<CustomerService>{
	
	
	/**
	 * 
	 */
	private static final long serialVersionUID = -7487986798801513224L;

	private static final Log log = Log.getLog(CustomerService.class);

	public static final CustomerService dao = new CustomerService().dao();
	
	
	
	/**
	 * 表名称
	 */
	public static final String table_name = "sb_customer_service";
	
	/**
	 * 字段描述：ids 字段类型：character varying 长度：32
	 */
	public static final String column_ids = "ids";
	
	/**
	 * 字段描述：机构ids 字段类型：character varying 长度：32
	 */
	public static final String column_organids= "organids";
	
	/**
	 * 字段描述：顾客ids 字段类型：character varying 长度：32
	 */
	public static final String column_customerID = "customerID";
	
	/**
	 * 字段描述：本次服务体重  字段类型：float
	 */
	public static final String column_weight = "weight";
	/**
	 * 字段描述：上次体重  字段类型：float
	 */
	public static final String column_lastWeight = "lastWeight";
	//https://ecs-buy.aliyun.com/#/prepay?data=eyJkYXRhIjp7ImR1cmF0aW9uIjoiMSIsInByaWNpbmdDeWNsZSI6IlllYXIiLCJxdWFudGl0eSI6IjEifSwiY29tcG9uZW50cyI6eyJ2bV9yZWdpb25fbm8iOiJjbi1iZWlqaW5nLWJ0Yy1hMDEiLCJ2bV9peiI6ImNuLWJlaWppbmctZCIsImluc3RhbmNlX3R5cGUiOlt7Imluc3RhbmNlX3R5cGUiOiJlY3MubjQubGFyZ2UiLCJpbnN0YW5jZV9nZW5lcmF0aW9uIjoiZWNzLTMifV0sInZtX3dlYl90eXBlIjoiMSIsImlvb3B0aW1pemVkIjoib3B0aW1pemVkIiwidm1fYmFuZHdpZHRoIjpbeyJ2bV9iYW5kd2lkdGgiOiIxMDI0Iiwidm1faXNfZmxvd190eXBlIjoiNSJ9XSwidm1fb3MiOlt7fV0sInN5c3RlbWRpc2siOlt7InN5c3RlbWRpc2tfY2F0ZWdvcnkiOiJjbG91ZF9lZmZpY2llbmN5Iiwic3lzdGVtZGlza19zaXplIjoiNDAiLCJzeXN0ZW1kaXNrX2RldmljZSI6Ii9kZXYveHZkYSJ9XSwiZGF0YWRpc2siOm51bGx9fQ%3D%3D
	/**
	 * 字段描述：服务人员  ids   字段类型：character varying 长度：32
	 */
	public static final String column_userID = "userID";
	/**
	 * 字段描述：是否手法   字段类型：character varying 长度：32
	 */
	public static final String column_isPlaster = "isPlaster";
	/**
	 * 字段描述：药贴数量   字段类型：character varying 长度：32
	 */
	public static final String column_plasterCount = "plasterCount";
	/**
	 * 字段描述：是否塑形   字段类型：character varying 长度：32
	 */
	public static final String column_isShaping = "isShaping";
	/**
	 * 字段描述：手法服务人员 字段类型：character varying 长度：32
	 */
	public static final String column_plasterServier = "plasterServier";
	/**
	 * 字段描述：开始时间 字段类型：datetime
	 */
	public static final String column_startTime = "startTime";
	
	/**
	 * 字段描述：结束时间 字段类型：datetime
	 */
	public static final String column_endTime = "endTime";
	
	/**
	 * 字段描述：校验码 字段类型：character varying 长度：32
	 */
	public static final String column_jyw = "jyw";
	
	/**
	 * 字段描述：备注 字段类型：character varying 长度：text
	 */
	public static final String column_bz = "bz";
	
	/**
	 * 字段描述：该条数据添加人员is  字段类型：character varying 长度：32
	 */
	public static final String column_createId = "createId";
	/**
	 * 字段描述：该条数据添加时间  字段类型：datetime 长度：0
	 */
	public static final String column_createDate = "createDate";
	/**
	 * 字段描述：该条数据更新人员id  字段类型：character varying 长度：100
	 */
	public static final String column_updateId = "updateId";
	/**
	 * 字段描述：该条数据更新时间  字段类型：datetime 长度：0
	 */
	public static final String column_updateDate = "updateDate";
	/**
	 * 字段描述：状态 string 长度：1正常  //2补录信息   0 删除
	 */
	public static final String column_dataStatus = "dataStatus";
	/**
	 * 字段描述：isGg是否达到标体（巩固顾客），0非巩固，1巩固,2：塑性
	 */
	public static final String column_isGg = "isGg";
	
	/**
	 * 字段描述：isgk是否是顾客自己填的
	 */
	public static final String column_isgk = "isgk";
	
	/**
	 * sqlId :sb.customerService.selByCusAndOrg
	 * 描述：根据顾客id和机构id查出服务记录
	 */
	public static final String sqlId_selByCusAndOrg= "sb.customerService.selByCusAndOrg";
	/**
	 * sqlId :sb.customerService.selByMonth
	 * 描述：根据顾客和机构查询某月
	 */
	public static final String sqlId_selByMonth= "sb.customerService.selByMonth1";
	/**
	 * sqlId :sb.customerService.selByDate
	 * 描述：根据顾客和机构查询某月
	 */
	public static final String sqlId_selByDate= "sb.customerService.selByDate";
	/**
	 * sqlId :sb.customerService.nearStaWeight
	 * 描述：邻近标体5斤的顾客
	 */
	public static final String sqlId_nearStaWeight= "sb.customerService.nearStaWeight";
	
	/**
	 * sqlId :sb.customerService.selByOrganDate
	 * 描述：根据时间和机构查询所有顾客
	 */
	public static final String sqlId_selByOrganDate= "sb.customerService.selByOrganDate";
	/**
	 * sqlId :sb.customerService.selNotoStoreByOrganDate
	 * 描述：根据时间和机构查询不到店顾客
	 */
	public static final String sqlId_selNotoStoreByOrganDate= "sb.customerService.selNotoStoreByOrganDate";
	
	/**
	 * sqlId :sb.customerService.selNotoStoreByOrganDate
	 * 描述：根据时间和顾客查询到店次数
	 */
	public static final String sqlId_selByCusDate= "sb.customerService.selByCusDate";
	/**
	 * sqlId :sb.customerService.selNotoStoreByOrganDate
	 * 描述：根据时间和顾客查询到目标
	 */
	public static final String sqlId_targetWei= "sb.customerService.targetWei";
	/**
	 * sqlId :sb.customerService.selMinByCus
	 * 描述：根据顾客查询最低体重
	 */
	public static final String sqlId_selMinByCus= "sb.customerService.selMinByCus";
	/**
	 * sqlId :sb.customerService.selNowByCus
	 * 描述：根据顾客查询上次体重
	 */
	public static final String sqlId_selNowByCus= "sb.customerService.selNowByCus";
	/**
	 * sqlId :sb.customerService.selNowByCus
	 * 描述：根据顾客查询上次体重
	 */
	public static final String sqlId_selSerByOrganids= "sb.customerService.selSerByOrganids1";
	
	/**
	 * sqlId :sb.customerService.selNowByCus
	 * 描述：根据顾客查询上次体重
	 */
	public static final String sqlId_selSerTodayByOrganids= "sb.customerService.selSerTodayByOrganids1";
	
	/**
	 * sqlId :sb.customerService.selNowByCus
	 * 描述：根据顾客查询上次体重
	 */
	public static final String sqlId_selSerDateByOrganids= "sb.customerService.selSerDateByOrganids";

	public static final String sqlId_selSerByStratTime= "sb.customerService.selSerByStratTime";
	
	public static final String sqlId_selSerByStratTimeDESC= "sb.customerService.selSerByStratTimeDESC";
	
	
	public static final String sqlId_selNextWeight= "sb.customerService.selNextWeight1";
	
	public static final String sqlId_selLastWeight= "sb.customerService.selLastWeight";

	public  List<CustomerService>  getCusSerByMonth(String organids,String customerIds,String month)
	{
		String sql = "SELECT  * from  sb_customer_service  WHERE  organids = ? AND customerID = ? AND startTime LIKE ?  ";
		return  CustomerService.dao.find(sql,organids,customerIds,"%"+month+"%");
	}
	
}
